package com.kandinfo.base.security;

import org.aopalliance.intercept.MethodInvocation;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.spring.security.interceptor.AopAllianceAnnotationsAuthorizingMethodInterceptor;

import com.kandinfo.base.security.util.RoleConstants;

public class ExAopAllianceAnnotationsAuthorizingMethodInterceptor extends  AopAllianceAnnotationsAuthorizingMethodInterceptor{
	public ExAopAllianceAnnotationsAuthorizingMethodInterceptor(){
		 super();
	}
	 public Object invoke(MethodInvocation methodInvocation) throws Throwable {
	        org.apache.shiro.aop.MethodInvocation mi = createMethodInvocation(methodInvocation);
	        if(SecurityUtils.getSubject().hasRole(RoleConstants.SUPER_ADMIN)){
	        	return methodInvocation.proceed();
	        }
	        return super.invoke(mi);
	 }
}
